<!DOCTYPE html>
<html lang="en">
<head>
    <title>添加文章 我的博客</title>
{{template "header"}}
</head>
<body>
{{template "nav" .}}

<div class="container ">
    <br>
    <h1>添加文章</h1>
    <form action="/topic" method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label>文章标题</label>
            <input type="text" class="form-control" name="title" required>
        </div>
        <div class="form-group">
            <label>文章分类</label>
        {{/*<input type="text" class="form-control" name="category" required>*/}}
            <select name="category" class="form-control">
            {{range .Categories}}
                <option value="{{.Title}}">{{.Title}}</option>
            {{end}}
            </select>
        </div>
        <div class="form-group">
            <label>文章内容</label>
            <textarea class="form-control" name="content" rows="10" required></textarea>
        </div>

        <div class="form-group">
            <label>文章附件</label>
            <input type="file" class="form-control" name="attachment" required>
        </div>

        <button type="submit" class="btn-primary btn">添加文章</button>
    </form>


</div>

<script src="/static/js/jquery-1.10.2.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
</body>
</html>>



